<?php
Yii::app()->clientScript->registerScriptFile('/ueditor/editor_config.js');
Yii::app()->clientScript->registerScriptFile('/ueditor/editor_all_min.js');
Yii::app()->clientScript->registerCssFile("/ueditor/themes/default/ueditor.css");
Yii::app()->clientScript->registerCss("x", '#ui-datepicker-div {z-index:999}');
Yii::app()->clientScript->registerCss("x2", '.ui-datepicker { width: 17em; padding: .2em .2em 0; z-index: 9999 !important; }');
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'fragment-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>64)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'content'); ?>
		<?php echo $form->error($model,'content'); ?>

		<script type="text/plain" id="editor" style="width: 600px;"><?php echo $model->content;?></script>
		<script>
        window.UEDITOR_CONFIG.textarea = "Fragment[content]";
        new UE.ui.Editor().render('editor');
	    </script>
	</div>

	<div class="row">	
		<?php echo $form->labelEx($model,'category_id'); ?>
		<?php echo $form->dropDownList($model,'category_id', array(
				'1'=>'公司简介',
				'2'=>'预设分类',
				'3'=>'预设分类',
				'4'=>'预设分类',
				'5'=>'预设分类',
				)); ?>
		<?php echo $form->error($model,'category_id'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->